#pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup")

#ifdef _DEBUG
#define _CRTDBG_MAP_ALLOC
//#define _CRTDBG_DETAILED
#include <stdlib.h>
#include <crtdbg.h>

#endif

#include "AEApplication.hpp"

using namespace std;
using namespace arete;
using namespace core;

LONG WINAPI CrashHandler(EXCEPTION_POINTERS *ExceptionInfo)
{
	return true;
}

int main (int argc, char** argv)
{
#ifdef _DEBUG
	_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
#endif

	{
		auto app = make_shared<AEApplication>();

		if(app->initialize(argv,argc))
			app->run();

		app.reset();
	}

	return 0;
}